using System;
using System.ComponentModel;
using System.Transactions;

using SIS.ENT;
using SIS.DAL;


/// <summary>
/// The TeacherOtherSkillsTableManager class is responsible for managing BO.TeacherOtherSkillsTable objects in the system.
/// </summary>
[DataObjectAttribute()]
public class TeacherOtherSkillsTableManager
  {

#region "Public Methods"

/// <summary>
/// Gets a list with all TeacherOtherSkillsTable objects in the database.
/// </summary>
/// <returns>A list with all TeacherOtherSkillsTable from the database when the database contains any, or null otherwise.</returns>
[DataObjectMethod(DataObjectMethodType.Select, true)]
public static TeacherOtherSkillsTableList GetList(){
return TeacherOtherSkillsTableDB.GetList();
}

[DataObjectMethod(DataObjectMethodType.Select, true)]
public static TeacherOtherSkillsTableList GetList(int userAccount)
{
    return TeacherOtherSkillsTableDB.GetList(userAccount);
}


/// <summary>
/// Gets a single TeacherOtherSkillsTable from the database without its data.
/// </summary>
/// <param name="teacherOtherSkillsKey">The TeacherOtherSkillsKey of the TeacherOtherSkillsTable in the database.</param>
/// <returns>A TeacherOtherSkillsTable object when the TeacherOtherSkillsKey exists in the database, or <see langword="null"/> otherwise.</returns>
[DataObjectMethod(DataObjectMethodType.Select, false)]
public static TeacherOtherSkillsTable GetItem(int teacherOtherSkillsKey){
return GetItem(teacherOtherSkillsKey, false);
}

/// <summary>
/// Gets a single TeacherOtherSkillsTable from the database.
/// </summary>
/// <param name="teacherOtherSkillsKey">The TeacherOtherSkillsKey of the TeacherOtherSkillsTable in the database.</param>
/// <param name="getTeacherOtherSkillsTableRecords">Determines whether to load all associated TeacherOtherSkillsTable records as well.</param>
/// <returns>
/// A TeacherOtherSkillsTable object when the TeacherOtherSkillsKey exists in the database, or <see langword="null"/> otherwise.
/// </returns>
[DataObjectMethod(DataObjectMethodType.Select, false)]
public static TeacherOtherSkillsTable GetItem(int teacherOtherSkillsKey, bool getTeacherOtherSkillsTableRecords){
TeacherOtherSkillsTable myTeacherOtherSkillsTable = TeacherOtherSkillsTableDB.GetItem(teacherOtherSkillsKey);
return myTeacherOtherSkillsTable;
}

/// <summary>
/// Saves a TeacherOtherSkillsTable in the database.
/// </summary>
/// <param name="myTeacherOtherSkillsTable">The TeacherOtherSkillsTable instance to save.</param>
/// <returns>The new TeacherOtherSkillsKey if the TeacherOtherSkillsTable is new in the database or the existing TeacherOtherSkillsKey when an item was updated.</returns>
[DataObjectMethod(DataObjectMethodType.Update, true)]
public static int Save(TeacherOtherSkillsTable myTeacherOtherSkillsTable){
using (TransactionScope myTransactionScope = new TransactionScope()){
int teacherOtherSkillsTableTeacherOtherSkillsKey = TeacherOtherSkillsTableDB.Save(myTeacherOtherSkillsTable);

//  Assign the TeacherOtherSkillsTable its new (or existing TeacherOtherSkillsKey).
myTeacherOtherSkillsTable.TeacherOtherSkillsKey = teacherOtherSkillsTableTeacherOtherSkillsKey;

myTransactionScope.Complete();

return teacherOtherSkillsTableTeacherOtherSkillsKey;
}
}

/// <summary>
/// Deletes a TeacherOtherSkillsTable from the database.
/// </summary>
/// <param name="myTeacherOtherSkillsTable">The TeacherOtherSkillsTable instance to delete.</param>
/// <returns>Returns true when the object was deleted successfully, or false otherwise.</returns>
[DataObjectMethod(DataObjectMethodType.Delete, true)]
public static bool Delete(TeacherOtherSkillsTable myTeacherOtherSkillsTable){
return TeacherOtherSkillsTableDB.Delete(myTeacherOtherSkillsTable.TeacherOtherSkillsKey);
}

[DataObjectMethod(DataObjectMethodType.Delete, true)]
public static bool Delete(int TeacherOtherSkillsKey)
{
    return TeacherOtherSkillsTableDB.Delete(TeacherOtherSkillsKey);
}

#endregion

}

